package A1_3;

import java.util.ArrayList;
import java.util.List;

public class Instructor {
    private String name;
    private Department department;
    private List<Subject> taughtSubjects;

    public Instructor(String name, Department department) {
        this.name = name;
        this.department = department;
        this.taughtSubjects = new ArrayList<>();
    }

    public void addTaughtSubject(Subject subject) {
        if (taughtSubjects.size() < 3) { // A teacher teaches 1-3 subjects
            taughtSubjects.add(subject);
        } else {
            System.out.println("An instructor can only teach up to 3 subjects.");
        }
    }

    public List<Subject> getTaughtSubjects() {
        return taughtSubjects;
    }

    public String getName() {
        return name;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }
}
